<?php
    if(!empty($_SERVER['HTTP_X_REQUESTED_WITH'])){
        $id=$_POST['arr_id'];
        $id=substr($id, 0, -1);
        $id=explode(',',$id);
        $result=del($GLOBALS['c'],$id);
        echo $result;die;
        //echo json_encode($cate);die;
    }
    //include_once 'init.php';
    if(!empty($_GET)){
        $id=$_GET['id'];

            $result=del($GLOBALS['c'],$id);
            if($result>0){
                echo '<script>alert("删除成功");location.href="index.php?c=news&a=list&admin=1";</script>';die;
            }else{
                echo '<script>alert("删除失败");history.go(-1);</script>';die;
            }
    }

?>